<template>
  <div class="app-container">
    <el-form ref="form" :model="form" :rules="rules" size="small" label-width="240px">
      <el-form-item label="垃圾分类设备数">
        <el-input v-model="form.typeDevice" style="width: 370px;"/>
      </el-form-item>
      <el-form-item label="绿色回收网点数">
        <el-input v-model="form.greenWeb" style="width: 370px;"/>
      </el-form-item>
      <el-form-item label="绿色分拣中心数">
        <el-input v-model="form.greenCore" style="width: 370px;"/>
      </el-form-item>
      <el-form-item label="碳排放总量">
        <el-input v-model="form.carbonEmissionTotal" style="width: 370px;"/>
      </el-form-item>
      <el-form-item label="碳排放强度">
        <el-input v-model="form.carbonEmissionIntensity" style="width: 370px;"/>
      </el-form-item>
      <el-form-item label="废品回收总量">
        <el-input v-model="form.wasteTotal" disabled style="width: 370px;"/>
      </el-form-item>
      <el-form-item label="本月废品回收总量">
        <el-input v-model="form.wasteTotalMonth" disabled style="width: 370px;"/>
      </el-form-item>
      <el-form-item label="废品总价值">
        <el-input v-model="form.wasteAmount" disabled style="width: 370px;"/>
      </el-form-item>
      <el-form-item label="中转场数">
        <el-input v-model="form.transferPlant" style="width: 370px;"/>
      </el-form-item>

      <!-- <el-form-item label="配送费">
        <el-select v-model="form.whether_delivery_price" style="width: 370px;">
          <el-option label="有" value="1"></el-option>
          <el-option label="无" value="0"></el-option>
        </el-select>
      </el-form-item> -->
      <!-- <el-form-item label="配送费计算方式" v-if="form.whether_delivery_price==='1'">
        <el-select v-model="form.type_delivery_price" style="width: 370px;">
          <el-option label="统一配送费" value="1"></el-option>
          <el-option label="最低配送+按距离配送" value="2"></el-option>
        </el-select>
      </el-form-item> -->

      <el-form-item label="">
        <el-button type="primary" @click="doSubmit">提交</el-button>
      </el-form-item>
    </el-form>

  </div>
</template>

<script>
import { putWasteCount, GetwasteCount } from '@/api/system/config'

export default {
  data() {
    return {
      delLoading: false,
      form: {
        category: 'delivery',
        rise_delivery_price: '0',
        whether_delivery_price: '0',
        type_delivery_price: '1',
        common_delivery_price: '',
        minimum_delivery_price: '',
        minimum_delivery_price_distance: '',
        beyond_delivery_price: ''
      },
      rules: {}
    }
  },
  created() {
    GetwasteCount().then(res => {
      const that = this
      that.form = res.data
    })
  },
  methods: {
    doSubmit() {
      putWasteCount(this.form).then(res => {
        this.$notify.success({
          title: '成功',
          message: '设置成功'
        })
      }).catch(err => {
        console.log(err.msg)
      })
    }

  }
}
</script>

<style scoped>

</style>
